/*
 * Created on 2005-3-23
 *
 * Copyright: Bluejay Networks Inc. 2005
 *
 * This software is the proprietary information of Bluejay Networks Inc. 
 * 
 * Use is subject to license terms.
 * 
 */
package com.ims.iaa.swf.datatype;

//HasAddTerms			hasAdd = UB[1]				Has color addition values if equal to 1
//HasMultTerms			hasMult = UB[1]				Has color multiply values if equal to 1
//Nbits					nBits = UB[4]				Bits in each value field
//RedMultTerm			If hasMult SB[nBits]		Red multiply value
//GreenMultTerm			If hasMult SB[nBits]		Green multiply value
//BlueMultTerm			If hasMult SB[nBits]		Blue multiply value
//RedAddTerm			If hasAdd SB[nBits]			Red addition value
//GreenAddTerm			If hasAdd SB[nBits]			Green addition value
//BlueAddTerm			If hasAdd SB[nBits]			Blue addition value

/**
 * @author ShengMengBai
 *
 */
public class CXForm {
    private int m_iStart = 0;
    private byte[] m_bytData = null;
    public CXForm(byte[] bytData, int iStart){
        m_bytData = bytData;
        m_iStart = iStart;
        parse();
    }
    private void parse(){
        m_iByteSize = 1;
        int iBytes = 6;
 		int iBits = (m_bytData[m_iStart] & 0x3F) >> 2;
 		iBytes = iBits / 8;
        if(iBits % 8 != 0){
            iBytes += 1;
        }
        if((m_bytData[m_iStart] & 0x80) != 0){
            m_iByteSize += iBytes * 3;
        }
        if((m_bytData[m_iStart] & 0x40) != 0){
            m_iByteSize += iBytes * 3;
        }
    }
    public int getHasAddTerms(){
        throw new RuntimeException("unImplement exception.");
    	//return m_iHasAddTerms;
    }
    public int getHasMultTerms(){
        throw new RuntimeException("unImplement exception.");
    	//return m_iHasMultTerms;
    }
    public int getNbits(){
        throw new RuntimeException("unImplement exception.");
    	//return m_iNbits;
    }
    public int getRedMultTerm(){
        throw new RuntimeException("unImplement exception.");
    	//return m_iRedMultTerm;
    }
    public int getGreenMultTerm(){
        throw new RuntimeException("unImplement exception.");
    	//return m_iGreenMultTerm;
    }
    public int getBlueMultTerm(){
        throw new RuntimeException("unImplement exception.");
    	//return m_iBlueMultTerm;
    }
    public int getRedAddTerm(){
        throw new RuntimeException("unImplement exception.");
    	//return m_iRedAddTerm;
    }
    public int getGreenAddTerm(){
        throw new RuntimeException("unImplement exception.");
    	//return m_iGreenAddTerm;
    }
    public int getBlueAddTerm(){
        throw new RuntimeException("unImplement exception.");
    	//return m_iBlueAddTerm;
    }
    public int getByteSize(){
    	return m_iByteSize;
    }

    private int m_iHasAddTerms;
    private int m_iHasMultTerms;
    private int m_iNbits;
    private int m_iRedMultTerm;
    private int m_iGreenMultTerm;
    private int m_iBlueMultTerm;
    private int m_iRedAddTerm;
    private int m_iGreenAddTerm;
    private int m_iBlueAddTerm;
    private int m_iByteSize;
}
